﻿// Learn more about F# at http://fsharp.net
// See the 'F# Tutorial' project for more help.

let isEven getal =
    getal % 2 = 0

let nextCollatz getal =
    match getal with
    | getal when getal |> isEven -> getal / 2
    | _ -> getal * 3 + 1

let rec collatz getal =
    match getal with
    | 1 -> [1]
    | _ -> getal :: (nextCollatz(getal) |> collatz)

[<EntryPoint>]
let main argv = 
    let x = collatz(10)
    printfn "%A" x
    0 // return an integer exit code
